package cn.cvs.service.impl;

import cn.cvs.dao.SysUserMapper;
import cn.cvs.pojo.Role;
import cn.cvs.pojo.SysUser;
import cn.cvs.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public List<SysUser> selectSysUserList(SysUser sysUser) {
        return sysUserMapper.selectSysUserList(sysUser);
    }

    @Override
    public List<Role> selectRole(String roleName) {
        return sysUserMapper.selectRole(roleName);
    }

    @Transactional
    @Override
    public int add(SysUser sysUser) {
        int result = sysUserMapper.add(sysUser);

        int n=1/0;
        return result;
    }

//    @Override
//    public int updateRole(Integer id, String roleName) {
//        return sysUserMapper.updateRole(id, roleName);
//    }
//
//    @Override
//    public int deleteRole(Integer id) {
//        return sysUserMapper.deleteRole(id);
//    }
}
